#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time         : 17-11-28 下午6:42
# @Author       : xiaohan
# @File         : metaclass.py
# @desc         : 

def func(instance):
    print(instance.a, instance.b)
    print(instance.method_a(10))


def generate_cls(a, b):
    class Fake(object):
        def method_a(self, n):
            return n

    Fake.a = a
    Fake.b = b

    return Fake


ins = generate_cls(1, 2)
print(ins)
print(ins().a)


def method_a(self, n):
    return n


new_ = {'a': 1, 'b': 2, 'method_a': method_a}
ina = type('Cat', (), new_)()

print(ina.method_a(20))

age = 35

age.__class__
